<div class="modal-header">
  <div class="modal-title">上传文件</div>
</div>
@if (!record) {
  <nz-spin class="modal-spin" />
} @else {
  @if (uploadFileList.length > 0) {
    <nz-list nzItemLayout="horizontal">
      @for (item of uploadFileList; track item) {
        <nz-list-item>
          <nz-list-item-meta>
            <nz-list-item-meta-title>
              {{ item.name }}
            </nz-list-item-meta-title>
            <nz-list-item-meta-description>
              <nz-space [nzSize]="'middle'">
                <div>
                  大小: <span style="margin-left: 10px; color: blue">{{ item.unitSize }}</span>
                </div>
                <div style="margin-left: 10px">
                  md5:
                  <span style="margin-left: 20px; color: red">
                    @if (item.md5Progress > 0 && item.md5Progress < 100) {
                      {{ item.md5Progress }}%
                    } @else {
                      {{ item.md5 }}
                    }
                  </span>
                </div>
              </nz-space>
              @if (item.progress) {
                <nz-progress [nzPercent]="item.progress" />
              }
            </nz-list-item-meta-description>
          </nz-list-item-meta>
          <ul nz-list-item-actions>
            <nz-list-item-action>
              <nz-tag [nzColor]="item.statusTag.color">
                {{ item.statusTag.text }}
              </nz-tag>
            </nz-list-item-action>
          </ul>
        </nz-list-item>
      }
    </nz-list>
  } @else {
    <nz-list-empty />
  }
  <div class="modal-footer">
    <nz-space>
      <nz-upload [nzBeforeUpload]="onBeforeUpload" [nzShowUploadList]="false" [(nzFileList)]="fileList" [nzDisabled]="uploading">
        <button nz-button><i nz-icon nzType="upload" nzTheme="outline"></i>选择文件 </button>
      </nz-upload>
      <button nz-button nzType="primary" (click)="onUpload()" [disabled]="uploadFileList.length <= 0 || uploading" style="margin-left: 20px"
        >上传</button
      >
      <button nz-button type="default" (click)="close()">关闭</button>
    </nz-space>
  </div>
}
